from PySide2.QtCore import QRect, QCoreApplication

from PySide2.QtWidgets import (
    QAction, QMenuBar, QMenu, QStatusBar,
    QVBoxLayout, QTableView, QLineEdit,

    QLabel, QDialog, QWidget, QHBoxLayout,
)


class Ui_MainWindow(object):
    def setupUi(self, window):
        if not window.objectName():
            window.setObjectName(u"window")
        window.resize(800, 600)

        # MenuBar
        self.actionOpen = QAction(window)
        self.actionOpen.setObjectName(u"actionOpen")
        self.actionQuit = QAction(window)
        self.actionQuit.setObjectName(u"actionQuit")

        self.actionHelp = QAction(window)
        self.actionHelp.setObjectName(u"actionHelp")
        self.actionAbout = QAction(window)
        self.actionAbout.setObjectName(u"actionAbout")

        self.menubar = QMenuBar(window)
        self.menubar.setObjectName(u"menubar")
        self.menubar.setGeometry(QRect(0, 0, 800, 22))

        self.menuFile = QMenu(self.menubar)
        self.menuFile.setObjectName(u"menuFile")
        self.menuHelp = QMenu(self.menubar)
        self.menuHelp.setObjectName(u"menuHelp")
        window.setMenuBar(self.menubar)

        self.menubar.addAction(self.menuFile.menuAction())
        self.menubar.addAction(self.menuHelp.menuAction())

        self.menuFile.addAction(self.actionOpen)
        self.menuFile.addSeparator()
        self.menuFile.addAction(self.actionQuit)

        self.menuHelp.addAction(self.actionHelp)
        self.menuHelp.addSeparator()
        self.menuHelp.addAction(self.actionAbout)

        # StatusBar
        self.statusbar = QStatusBar(window)
        self.statusbar.setObjectName(u"statusbar")
        window.setStatusBar(self.statusbar)
        self.statusbar.showMessage("Welcome")

        # centralwidget
        self.centralwidget = QWidget(window)
        self.centralwidget.setObjectName(u"centralwidget")
        window.setCentralWidget(self.centralwidget)

        self.main_layout = QHBoxLayout(self.centralwidget)

        self.table = QTableView(self.centralwidget)
        self.table.setObjectName(u"table")
        # self.table.setSelectionBehavior(QAbstractItemView.SelectRows)

        self.right = QWidget(window)

        self.main_layout.addWidget(self.table)
        self.main_layout.addWidget(self.right)
        self.right_layout = QVBoxLayout(self.right)

        self.nameEdit = QLineEdit(self.right)
        self.emailEdit = QLineEdit(self.right)

        self.right_layout.addWidget(self.nameEdit)
        self.right_layout.addWidget(self.emailEdit)

        self.nameLabel = QLineEdit(self.right)
        self.emailLabel = QLineEdit(self.right)

        self.nameLabel.setReadOnly(True)
        self.emailLabel.setReadOnly(True)

        self.nameLabel.setText('qewqew')
        self.emailLabel.setText('emmm')

        self.right_layout.addWidget(self.nameLabel)
        self.right_layout.addWidget(self.emailLabel)

        # self.main_layout = QHBoxLayout()

        # self.main_layout.addWidget(QLabel('qweqwe'))

        # self.centralwidget.setLayout(self.main_layout)
        # window.setCentralWidget(self.centralwidget)

        # # QWidget Layout
        # self.main_layout = QHBoxLayout()

        self.retranslateUi(window)

    def retranslateUi(self, window):
        window.setWindowTitle(
            QCoreApplication.translate("Window", u"Window", None))

        self.menuFile.setTitle(
            QCoreApplication.translate("Window", u"File", None))

        self.actionOpen.setText(
            QCoreApplication.translate("Window", u"Open", None))

        self.actionQuit.setText(
            QCoreApplication.translate("Window", u"Quit", None))

        self.menuHelp.setTitle(
            QCoreApplication.translate("Window", u'Help', None))
        self.actionHelp.setText(
            QCoreApplication.translate("Window", u"Help", None))

        self.actionAbout.setText(
            QCoreApplication.translate("Window", u"关于", None))
